<!-- 楼宇详情 -->
<template>
  <div class="layout">
    <div class="titleDiv">
      <div class="b-title">{{buildingName}}</div>
      <div class="tabBar">
        <div
          v-for="(item, index) in tabBar"
          :key="index"
          @click="tabChange(item.value)"
          :class="{ bgColor: show == index + 1 }">
          {{ item.name }}
        </div>
        <div></div>
      </div>
    </div>
    <div v-if="show == 1">
      <PremisesDetail :Detail="id"></PremisesDetail>
    </div>
    <div v-if="show == 2">
      <LikeCompany></LikeCompany>
    </div>
  </div>
</template>

<script>
import PremisesDetail from "./premisesDetail.vue";
import LikeCompany from "./likeCompany.vue";
export default {
  components: {
    PremisesDetail,
    LikeCompany,
  },
  data() {
    //这里存放数据
    return {
      crumbs: [
        {
          label: "企业空间",
          value: "company",
        },
        {
          label: "招商中心",
          value: "investment",
        },
        {
          label: "我的楼宇",
          value: "myBuilding",
        },
        {
          label: "楼宇详情",
          value: "",
          choose: true,
        },
      ],
      tabBar: [
        {
          value: 1,
          name: "楼宇详情",
          active: true,
        },
        {
          value: 2,
          name: "意向企业",
          active: false,
        },
      ],
      show: 1,
      id: "",
      buildingName: '',
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    // tabBar
    tabChange(value) {
      this.show = value;
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    if (this.$route.query.type) {
      this.show = this.$route.query.type;
    }
    if(this.$route.query.name) {
      this.buildingName = this.$route.query.name
    }
  },
};
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
.breadcrumb {
  width: 1000px;
  margin: 20px 0;
}

.roomDiv {
  display: flex;
  justify-content: center;
}

.roomDiv .leftDiv {
  width: 200px;
  text-align: left;
}

.roomDiv .rightDiv {
  width: 800px;
  margin-left: 30px;
}

.titleDiv {
  border-bottom: 2px solid #045db9;
  text-align: left;
  padding: 0;
  font-size: 16px;
  font-weight: bold;
  color: #63666a;
  margin-bottom: 20px;
}

.titleDiv .tabBar {
  display: flex;
  margin-left: 10px;
  margin-bottom: -2px;
}
.titleDiv .tabBar div {
  padding: 12px 23px;
  cursor: pointer;
}

.bgColor {
  color: #ffffff;
  background: #045db9;
}

.b-title {
  color: #333;
  font-weight: bold;
  font-size: 24px;
  text-align: left;
  margin-bottom: 15px;
}

.msgDiv {
  margin: 40px 0;
}

.toLoginBtn {
  color: #ffffff;
  background-color: #045db9;
  padding: 10px 40px;
  display: inline-block;
  font-size: 15px;
  border-radius: 5px;
  transition: all 0.2s ease 0s;
}

.toLoginBtn:hover {
  cursor: pointer;
  box-shadow: 0px 0px 5px #eeeeee;
}

.layout {
  min-height: 100vh;
  position: relative;
  padding-bottom: 150px;
  box-sizing: border-box;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}
</style>